<template>
  <div class="cpjyxjlBox">
    <!-------------------- 吹瓶机运行记录 -------------------->
    <TableHeader
      :data="{
        mainTitle: '灌装机操作记录',
        date: '2021年12月12日',
        company: '青岛崂山矿泉水有限公司',
        code: 'LK-QF-LS1-10-012-11-01',
      }"
    />
    <CommonVxeTable :tableData="tableData1" />
    <RowcolTableVxeTable
      :tableData="tableData2"
      :slots="['检查项目', '时间']"
    />
    <CommonVxeTable :tableData="tableData3" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData1: {
        columns: [
          {
            field: "value",
            title: "产品名称",
            align: "center",
            minWidth: "100px",
          },
          {
            title: "开机时间",
            align: "center",
            minWidth: "100px",
            field: "value",
          },
          {
            title: "停机时间",
            align: "center",
            minWidth: "100px",
            field: "value",
          },
          {
            title: "PET瓶损耗数量",
            align: "center",
            minWidth: "100px",
            field: "value",
          },
          {
            field: "value",
            align: "center",
            minWidth: "100px",
            title: "瓶盖损耗数量",
          },
            {
            title: "空调运行情况",
            align: "center",
            minWidth: "100px",
            field: "value",
          },
          {
            title: "臭氧杀菌系统开启时间",
            align: "center",
            minWidth: "100px",
            field: "value",
          },
          {
            field: "value",
            align: "center",
            minWidth: "100px",
            title: "运行情况",
          },
        ],
        data: [],
      },
      tableData2: {
        columns: [
          {
            slots: { header: "header" },
            field: "value",
            minWidth: "100px",
            title: "灌装容量",
            height:100
          },
          {
            field: "value",
            minWidth: "100px",
            title: "压盖",
          },
          {
            field: "value",
            minWidth: "100px",
            title: "水质",
          },
          {
            field: "value",
            minWidth: "100px",
            title: "冲盖终端过滤器压力",
          },
          {
            field: "value",
            minWidth: "100px",
            title: "灌装终端过滤器压力",
          },
          {
            field: "value",
            minWidth: "100px",
            title: "真空泵运行情况",
          },
          {
            field: "value",
            minWidth: "100px",
            title: "真空泵压力",
          },
          {
            field: "value",
            minWidth: "100px",
            title: "一道冲盖水压力",
          },
          {
            field: "value",
            minWidth: "100px",
            title: "坯身温度（℃）",
          },
          {
            field: "value",
            minWidth: "100px",
            title: "二道冲盖水压力",
          },
        ],
        data: [],
      },
      tableData3: {
        border: true,
        stripe: true,
        resizable: true,
        columns: [
          {
            field: "value",
            minWidth: "100px",
            title: "项目",
            align: "center",
          },
          {
            field: "value",
            minWidth: "100px",
            title: "工艺要求",
            align: "center",
          },
          {
            title: "执行情况",
            align: "center",
            field: "value",
            minWidth: "100px",
          },
        ],
        data: [],
      },
    };
  },
  created() {
    for (let i = 0; i < 4; i++) {
      this.tableData1.data.push({
        value: 131244,
      });
      this.tableData3.data.push({
        value: 1335231244,
      });
      this.tableData2.data.push({
        date: "2012-12-12",
        value: 1231231231,
      });
    }
  },
  methods: {
    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
      // console.log(row, column, rowIndex, columnIndex);
      if (rowIndex % 2 === 0) {
        if (columnIndex === 0) {
          // return [2, 2];
        }
      }
      // if (rowIndex === 0) {
      if (columnIndex <= 0) {
        return [1, 2];
      }
      // }
    },
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0) {
        if (rowIndex % 2 === 0) {
          return {
            rowspan: 2,
            colspan: 1,
          };
        } else {
          return {
            rowspan: 0,
            colspan: 0,
          };
        }
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.cpjyxjlBox {
  width: 100%;
  // background: red;
}
</style>>

